package com.ll.wechat.base.activity;

import android.view.KeyEvent;
import android.view.Menu;
import android.view.MenuInflater;
import android.view.MenuItem;

import com.ll.wechat.R;

/**
 * 主页面
 * 
 * @ClassName: MainActivity
 * @author yeliangliang
 * @date 2015-7-24 下午5:24:20
 */
public class MainActivity extends BaseActivity {

	@Override
	public void initView() {
		setContentView(R.layout.activity_main);
		//取消actionBar的图标
		getActionBar().setDisplayShowHomeEnabled(false); 
	}

	@Override
	public void initData() {
		
	}
	//返回键的监听
	@Override
	public boolean onKeyDown(int keyCode, KeyEvent event) {
		if (keyCode == KeyEvent.KEYCODE_BACK && event.getAction() == KeyEvent.ACTION_DOWN) {
			exitApp(MainActivity.this);
			return true;
		}
		return super.onKeyDown(keyCode, event);
	}
	/**
	 * 创建ActionBar菜单
	 */
	@Override
	public boolean onCreateOptionsMenu(Menu menu) {
		MenuInflater inflater = getMenuInflater();  
	    inflater.inflate(R.menu.main, menu);  
		return super.onCreateOptionsMenu(menu);
	}
	/**
	 * ActionBar的点击监听
	 */
	@Override
	public boolean onOptionsItemSelected(MenuItem item) {
		return super.onOptionsItemSelected(item);
	}
	
}
